package com.mall.test.domain.dto;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class ProductInfo {

    private String goodsName;
    private List<SalesRecord> data;
    private Integer totalCount;


    public ProductInfo(String goodsName){
        this.goodsName=goodsName;
        this.data=new ArrayList<>();
        this.totalCount=0;
    }

    public void addSalesRecord(Integer month,Integer sales){
        this.data.add(new SalesRecord(month,sales));
        this.totalCount+=sales;
    }
}
